package com.ug_project.spring_dict.DataAccess.Migrations.DictTables

import com.ug_project.spring_dict.DataAccess.Migrations.BaseIdTable
import com.ug_project.spring_dict.DataAccess.Migrations.Users

abstract class DictTable(name: String) : BaseIdTable(name) {
    open val key = varchar("KeyWord", 78)
    open val value = varchar("Value", 512)
    open val creator = integer("Creator") references Users.id.index()
    open val accessibility = integer("Accessibility")

    init {
        index(false, key, accessibility)
    }

    companion object {
        object Accessibility{
            const val Unavailable = 0
            const val Waiting = 1
            const val Available = 2
        }
        object DictionaryDirections {
            const val ZhUg = "zh-ug"
            const val ZhEn = "zh-en"
            const val ZhZh = "zh-zh"
            const val UgZh = "ug-zh"
            const val UgEn = "ug-en"
            const val UgUg = "ug-ug"
            const val EnUg = "en-ug"
            const val EnZh = "en-zh"
            const val EnEn = "en-en"
        }
    }
}